//用于显示个人空间的tabPanel
var personSpaceTabPanel = Ext.create('Ext.tab.Panel', {
    border:false,
    defaults: {
        layout: 'fit',
        border:false
    },
    items: [{
        title: '个人信息',
        items: [personalMessageForm]
    }, {
        title: '修改密码',
        items: [updatePasswordForm]
    }, {
        title: '所属信息',
        itemId:'viewPort'
        // items: [personalViewPort]

    }],
    listeners: [{
        tabchange: function (tabPanel, newCard, oldCard, eOpts) {
            if (newCard.title == '个人信息')
                personSpaceTabClick(0);
            else if (newCard.title == '修改密码')
                personSpaceTabClick(1);
            else if (newCard.title == '所属信息')
                personSpaceTabClick(2);
        }
    }]
});

//用于显示班级详细信息的tabPanel
var personalSpaceClassesTabPanel = Ext.create("Ext.tab.Panel", {
    border:false,
    defaults: {
        layout: 'fit',
        border:false
    },
    title: '班级详情',
    items: [{
        title: '详细信息',
        itemId: 'detailForm',
        items: [personalSpaceClassesDetailForm]
    }, {
        title: '人员信息',
        itemId: 'memberGrid',
        items: [personalSpaceClassesMemberGrid]
    }]
});

//用于显示组详细信息的tabPanel
var personalSpaceGroupTabPanel = Ext.create("Ext.tab.Panel", {
    title: '组详情',
    border:false,
    defaults: {
        layout: 'fit',
        border:false
    },
    items: [{
        title: '详细信息',
        itemId: 'detailForm',
        items: [personalSpaceGroupDetailForm]
    }, {
        title: '人员信息',
        itemId: 'memberGrid',
        items: [personalSpaceGroupMemberGrid]
    }]
});

//用于显示项目详细信息的tabPanel
var personalSpaceProjectTabPanel = Ext.create("Ext.tab.Panel", {
    title: '项目详情',
    border:false,
    defaults: {
        layout: 'fit',
        border:false
    },
    items: [{
        title: '详细信息',
        itemId: 'detailForm',
        items: [personalSpaceProjectDetailForm]
    }, {
        title: '成绩信息',
        itemId: 'gradeGrid',
        items: [personalSpaceGradeGrid]
    }],
    listeners: [{
        tabchange: function (tabPanel, newCard, oldCard, eOpts) {
            if (newCard.title == '成绩信息') {
                var selectArray = personalSpaceLeftTreePanel.getSelectionModel().getSelected();// 得到被选择的行的数组.
                personalSpaceGradeStore.proxy.url = zuulUrl + '/' + testServiceName + '/testProject/grade/' + selectArray.items[0].data.id + '/' + currentUserId;
                personalSpaceGradeStore.reload();
            }
        }
    }]
});

